const { NOt_FIND_THIS_QUESTION } = require('../error/errorType')
const questionService = require('../service/question.service')
const verifyQuestion = async (ctx, next) => {
  const { typeId } = ctx.request.query

  if (typeId < 1 || typeId > 6) {
    // console.log(1);
    return ctx.app.emit('error', new Error(NOt_FIND_THIS_QUESTION), ctx)
  }
  
  const questionInfo = {
    typeId
  }
  ctx.questionInfo = questionInfo
  await next()
}

module.exports = {
  verifyQuestion
}